
#include "../include/Distributions.hpp"
#include "../include/utils.hpp"
//#include "../include/Gibbs.hpp"
//#include "../include/SmcSampler.hpp"
#include "../include/Resample.hpp"
#include "../include/HMC_trunc.hpp"
#include "../include/OrthantBS.hpp"
#include "../include/Orthan.hpp"
#include "../include/Orthan2.hpp"
#include "../include/Orthantst.hpp"
#include "../include/Orthanghk.hpp"
#include "../include/Orthantsampler.hpp"
#include "../include/Orthantsampler2.hpp"
#include "../include/Orthanghkcache.hpp"
#include "../include/Misc/EP_tg.hpp"
#include "../include/Misc/EP_tg_sep.hpp"
#include "../include/Orthanghkst.hpp"
#include "../include/spatialprobit/GibbsSP.hpp"
#include "../include/spatialprobit/PMCMC_SP.hpp"
extern "C"{

	void GibbsspatialProbit(double *W, int *M, double *X, double *Y, int *n, int *p, double *res, double *rho)
	{
		mat mW=vect2mat<double>(W,*n,*n);
		mat mX=vect2mat<double>(X,*n,*p);
		mat mY=vect2mat<double>(Y,*n,1);
		GibbsSP GSP(mX,mY,mW);
		vector<mat> V=GSP(*M);
	//	cout << V[0];
		mat2vect<double>(V[0],*M,*p,res);
		mat2vect<double>(V[1],*M,1,rho);
	}
	void PMCMCspatialProbit(double *W, int *M, double *X, double *Y, int *n, int *p, double *res, double *rho)
	{
		mat mW=vect2mat<double>(W,*n,*n);
		mat mX=vect2mat<double>(X,*n,*p);
		mat mY=vect2mat<double>(Y,*n,1);
	
		PMCMC_SP PMH(mY,mX,mW);
		vector<mat> V=PMH(*M,100);
		//cout << V[0];
		mat2vect<double>(V[0],*M,*p,res);
		mat2vect<double>(V[1],*M,1,rho);
	}


}
